import request from '@/utils/request'

// 获取月卡信息
// export const getCardListAPI = (params) => { request.get('/parking/card/list', params) }
export function getCardListAPI(params) {
  return request({
    url: '/parking/card/list',
    method: 'GET',
    params
  })
}
// 添加月卡
export const addCardAPI = (data) => {
  request.post('/parking/card', data)
}
// export function addCardAPI(data) {
//   return request({
//     url: '/parking/card',
//     method: 'POST',
//     data
//   })
// }
// 删除
export const deleteCardAPI = (id) => {
  request.delete(`/parking/card/${id}`)
}
// 编辑
// export const editCardAPI = (id) => { request.get(`/parking/card/detail/${id}`) }
export function getCardDetailAPI(id) {
  return request({
    url: `/parking/card/detail/${id}`
  })
}
// // 编辑月卡
// export const editCardAPI = (data) => {
//   request.put('/parking/card/edit', data)
// }
export function editCardAPI(data) {
  return request({
    url: '/parking/card/edit',
    method: 'PUT',
    data
  })
}
// 批量删除
export const deleteCardBatchAPI = (idList) => {
  request.delete(`/parking/card/${idList.join(',')}`)
}
